<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCashFlowsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('cash_flow', function(Blueprint $table)
		{
			$table->increments('id');
			$table->timestamps();
			//关联tyw_financing
			$table->integer('financing_id');
			//double 13 2 销售商品、提供劳务收到的现金
			$table->double('salary_got',13,2);
			//double 13 2 收到的税费返还
			$table->double('tax_back',13,2);
			//double 13 2 收到的其他与经营活动有关的现金
			$table->double('other_cash_back',13,2);
			//double 13 2 现金流出小计
			$table->double('cash_out_subtotal',13,2);
			//double 13 2 经营活动产生的现金流量净额
			$table->double('business_pure_income',13,2);
			//double 13 2 收到投资所收到的现金
			$table->double('invest_cash_back',13,2);
			//double 13 2 取得投资收益所收到的现金
			$table->double('invest_incoming',13,2);
			//double 13 2 处置固定资产、无形资产和其他长期资产所收回的现金净额
			$table->double('selling_cash_pure',13,2);
			//double 13 2 处置子公司及其他营业单位收到的现金净额
			$table->double('subcompany_selling_cash',13,2);
			//double 13 2 收到的其他与投资活动有关的现金
			$table->double('other_activity_cash',13,2);
			//double 13 2 现金流入小计
			$table->double('cash_income_subtotal',13,2);
			//double 13 2 购建固定资产、无形资产和其他长期资产所支付的现金
			$table->double('bought_pay_cash',13,2);
			//double 13 2 投资所支付的现金
			$table->double('invest_pay_cash',13,2);
			//double 13 2 取得子公司及其他营业单位支付的现金净额
			$table->double('cash_from_subcompany',13,2);
			//double 13 2 支付的其他与投资活动有关的现金
			$table->double('other_paied_cash',13,2);
			//double 13 2 投资活动产生的现金流量 中的 现金流出 小计
			$table->double('invest_out_subtotal',13,2);
			//double 13 2 投资活动产生的现金流量净额
			$table->double('invest_cash_total',13,2);
			//double 13 2 吸收投资所收到的现金
			$table->double('cash_from_invest',13,2);
			//double 13 2 借款所收到的现金
			$table->double('cash_from_borrow',13,2);
			//double 13 2收到的其他与筹资活动有关的现金
			$table->double('cash_from_other',13,2);
			//double 13 2 筹资活动产生的现金流量 中的现金流入小计
			$table->double('raise_cash_income_subtotal',13,2);
			//double 13 2 偿还债务所支付的现金
			$table->double('debt_out_cash',13,2);
			//double 13 2 分配股利、利润或偿付利息所支付的现金
			$table->double('dis_pay_cash',13,2);
			//double 13 2 支付的其他与筹资活动有关的现金
			$table->double('other_pay_cash',13,2);
			//double 13 2 筹资活动产生的现金流量 中的现金流出小计
			$table->double('raise_cash_out_subtotal',13,2);
			//double 13 2 筹资活动产生的现金流量净额
			$table->double('raise_cash_total',13,2);
			//double 13 2 汇率变动对现金的影响额
			$table->double('cash_effect_from_exchangerate',13,2);
			//double 13 2 现金及现金等价物净增加额
			$table->double('pure_raise_cash',13,2);
			//double 13 2 净利润
			$table->double('pure_profits',13,2);
			//double 13 2 计提的资产减值准备
			$table->double('ready_for_decrease',13,2);
			//double 13 2 累计折旧
			$table->double('accumulated_depreciation',13,2);
			//double 13 2 无形资产摊销
			$table->double('intangible_asset',13,2);
			//double 13 2 长期待摊费用摊销
			$table->double('promote_sales',13,2);
			//double 13 2 待摊费用减少
			$table->double('prepaid_reduce',13,2);
			//double 13 2 预提费用增加
			$table->double('withholding_increase',13,2);
			//double 13 2 处置固定资产、无形资产和其他长期资产的损失
			$table->double('assets_loss',13,2);
			//double 13 2固定资产报废损失
			$table->double('scrap_loss',13,2);
			//double 13 2 公允价值变动损益
			$table->double('changes_loss',13,2);
			//double 13 2 财务费用
			$table->double('financial_cost',13,2);
			//double 13 2 投资损失
			$table->double('invest_loss',13,2);
			//double 13 2 递延所得税负债
			$table->double('income_tax_liabilities',13,2);
			//double 13 2 存货的减少
			$table->double('inventory_reduction',13,2);
			//double 13 2 经营性应收项目的减少
			$table->double('business_receivables_decrease',13,2);
			//double 13 2 经营性应收项目的增加
			$table->double('business_receivables_increase',13,2);
			//double 13 2 其它
			$table->double('other',13,2);
			//double 13 2 经营性活动产生的现金流量净额
			$table->double('business_activities_cash_flow',13,2);
			//double 13 2 债务转为资本
			$table->double('debt_into_capital',13,2);
			//double 13 2 一年内到期的可转换公司债券
			$table->double('convertible_corporate_bonds',13,2);
			//double 13 2 融资租入固定资产
			$table->double('for_fixed_assets',13,2);
			//double 13 2 现金的期末余额
			$table->double('ending_balance_cash',13,2);
			//double 13 2 现金的期初余额
			$table->double('begin_balance_cash',13,2);
			//double 13 2 现金等价物的期末余额
			$table->double('cash_equivalents_ending_balance',13,2);
			//double 13 2 现金等价物的期初余额
			$table->double('cash_equivalents_begin_balance',13,2);
			//double 13 2 现金及现金等价特净增加额
			$table->double('increase_in_cash',13,2);
			$table->softDeletes();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('cash_flows');
	}

}
